"""
存款案例
"""
money = 50000
flag = True


def index():
    print("--------------主菜单--------------")
    print("欢迎来到python提款机系统")
    print("查询余额   [输入1]")
    print("存款      [输入2]")
    print("取款      [输入3]")
    print("退出      [输入4]")
    print()


def get():
    print("--------------查询余额--------------")
    print(f"您好，您的余额为:{money}")
    print()


def add():
    print("--------------充值--------------")
    save = int(input("请输入您要充值的额度:"))
    global money
    print(f"您充值了:{save}")
    money = money + save
    print(f"现在您的余额为:{money}")
    print()


def sup():
    print("--------------提款--------------")
    spu = int(input("请输入您要提款的额度:"))
    global money
    print(f"您提款了:{spu}")
    money = money - spu
    print(f"现在您的余额为:{money}")
    print()


while flag:
    index()
    choose = int(input("请输入您的选择:"))
    if choose == 1:
        get()
    elif choose == 2:
        add()
    elif choose == 3:
        sup()
    elif choose == 4:
        flag = False
    else:
        print("您输入的不合法，请重新输入")
        print()
